package cn.dlx.blog.interceptor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class ArticleClickInterceptor implements HandlerInterceptor {
    @Autowired
    private RedisTemplate template;

//    @Override
//    public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o) throws Exception {
//        String uri = httpServletRequest.getServletPath().split("/")[2];
//        String uriKey = RedisKeyUntil.getClickCountKey(uri);
//        jedisService.zincrby("hotArticles",uriKey);
//        return true;
//    }
}
